<template>
	<view class="join-the-store">
		<!--师傅 申请门店 -->
		<u-navbar leftIconSize="34rpx" autoBack :placeholder="true" bgColor="#ffffff">
			<view class="" slot="center">
				<text class="c-000 pf-sc fw-600" style="font-size: 34rpx;">合伙人申请</text>
			</view>
		</u-navbar>
		<view
			class="set-pwd-container w-750 b-box  bg-fa po-re"
			:style="{ height: containerHeight }"
			v-if="rz.status != 0 && rz.status != 1 && rz.status != 2"
		>
			<scroll-view scroll-y="true" :style="{ height: containerHeight }" v-if="value == '门店'">
				<view style="padding: 20rpx 0 58rpx;">
					<view class="w-750 bg-ff b-box p-x-32" style="margin-bottom: 22rpx;padding-top: 32rpx;">
						<view
							class="d-flex flex-r ali-i-c just-c b-box"
							style="padding: 34rpx 0rpx;border-bottom: 2rpx solid #EEEEEE;"
							@click="showSex = true"
						>
							<text
								class="pf-sc fw-400"
								style="font-size: 30rpx;color: rgba(0,0,0,0.9000);margin-right: 24rpx;"
							>
								合伙人类型
							</text>
							<u-input
								type="text"
								border="none"
								:placeholder="value"
								v-module="value"
								disabledColor="#ffffff"
								disabled
								disableDefaultPadding
								placeholderStyle="color:#000;fontWeight:400;fontsize:30px;fontfamily:PingFang SC-Regular, PingFang SC"
								:customStyle="{ color: 'rgba(0,0,0,0.9000)', font: '400 30rpx PingFang SC' }"
							></u-input>
						</view>
						<u-action-sheet
							:show="showSex"
							:actions="actions"
							title="请选择您的身份"
							@close="showSex = false"
							@select="sexSelect"
						></u-action-sheet>

						<view
							class="d-flex flex-r ali-i-c just-c b-box"
							style="padding: 34rpx 0;border-bottom: 2rpx solid #EEEEEE;"
						>
							<text
								class="pf-sc fw-400"
								style="font-size: 30rpx;color: rgba(0,0,0,0.9000);margin-right: 24rpx;"
							>
								合伙人姓名
							</text>
							<u-input
								type="text"
								border="none"
								placeholder="请输合伙人姓名"
								disabledColor="#ffffff"
								v-model="name"
								placeholderStyle="color:#999999;fontWeight:400;fontsize:30px;fontfamily:PingFang SC-Regular, PingFang SC"
								:customStyle="{ color: 'rgba(0,0,0,0.9000)', font: '400 30rpx PingFang SC' }"
							></u-input>
						</view>
						<view
							class="d-flex flex-r ali-i-c just-c b-box"
							style="padding: 34rpx 0;border-bottom: 2rpx solid #EEEEEE;"
						>
							<text
								class="pf-sc fw-400"
								style="font-size: 30rpx;color: rgba(0,0,0,0.9000);margin-right: 80rpx;"
							>
								手机号
							</text>
							<u-input
								type="number"
								border="none"
								placeholder="请输入手机号"
								v-model="phone"
								placeholderStyle="color:#999999;fontWeight:400;fontsize:30px;fontfamily:PingFang SC-Regular, PingFang SC"
								:customStyle="{ color: 'rgba(0,0,0,0.9000)', font: '400 30rpx PingFang SC' }"
							></u-input>
						</view>
						<view
							class="d-flex flex-r ali-i-c just-c b-box"
							style="padding: 34rpx 0;border-bottom: 2rpx solid #EEEEEE;position: relative;"
						>
							<text
								class="pf-sc fw-400"
								style="font-size: 30rpx;color: rgba(0,0,0,0.9000);margin-right: 46rpx;position: absolute;left: 0;top: 42rpx;"
							>
								所在地区
							</text>
							<pick-regions
								style="width:352rpx;"
								:defaultRegion="defaultRegionCode"
								@getRegion="handleGetRegion"
							>
								<text
									style="display: inline-block;margin-top:6rpx;width:690rpx; font:400 30rpx PingFang SC;color:#999999;padding:5rpx 0 10rpx;"
									:class="{ cc: showAddress }"
								>
									{{ showAddress || '请选择收货地区(省/市/区/县)' }}
								</text>
							</pick-regions>
						</view>
						<view class="d-flex flex-r ali-i-c just-c b-box" style="padding: 34rpx 0;">
							<text
								class="pf-sc fw-400"
								style="font-size: 30rpx;color: rgba(0,0,0,0.9000);margin-right: 46rpx;"
							>
								详细地址
							</text>
							<u-input
								type="text"
								border="none"
								placeholder="街道、楼牌号等"
								v-model="dizhiXX"
								placeholderStyle="color:#999999;fontWeight:400;fontsize:30px;fontfamily:PingFang SC-Regular, PingFang SC"
								:customStyle="{ color: 'rgba(0,0,0,0.9000)', font: '400 30rpx PingFang SC' }"
							></u-input>
						</view>
					</view>
					<!-- 上传 -->
					<view class="w-750 bg-ff b-box p-x-32" style="padding-top: 32rpx; margin-bottom:60rpx">
						<view class="d-flex flex-r ali-i-c  b-box" style="padding: 34rpx 0;">
							<view
								class="d-flex flex-c ali-i-s just-s "
								style="margin-right: 20rpx;width: 150rpx;"
							>
								<view
									class="pf-sc fw-400"
									style="font-size: 30rpx;color: rgba(0,0,0,0.9000);width: 150rpx;"
								>
									门店照片
								</view>
								<view
									class="pf-sc fw-400"
									style="font-size: 30rpx;color: rgba(0,0,0,0.9000);width: 150rpx;"
								>
									或营业执照
								</view>
							</view>
							<view @click="uploadimg(0)" style="display: flex;">
								<view v-if="shopimages.length > 0">
									<image
										v-for="item in shopimages"
										:key="item"
										:src="item"
										mode="widthFix"
										style="width: 126rpx;height: 126rpx;margin-right: 5rpx;margin-top: 5rpx;"
									></image>
								</view>
								<!-- 'https://www.chejingjing.cn' + -->
								<view v-if="shopimages.length < 9">
									<image
										:src="require('../static/add.png')"
										mode="widthFix"
										style="width: 126rpx;height: 126rpx;"
									></image>
								</view>
							</view>
						</view>

						<view class="d-flex flex-r ali-i-c  b-box" style="padding: 34rpx 0;">
							<view class="d-flex flex-c ali-i-s just-s " style="width: 166rpx;">
								<text class="pf-sc fw-400" style="font-size: 30rpx;color: rgba(0,0,0,0.9000);">
									身份证
								</text>
								<text class="pf-sc fw-400" style="font-size: 30rpx;color: rgba(0,0,0,0.9000);">
									正反面
								</text>
							</view>
							<view @click="uploadimg(1)" style="margin-right: 40rpx;">
								<image
									v-if="idtimage"
									:src="'https://www.chejingjing.cn' + idtimage"
									mode="widthFix"
									style="width: 126rpx;height: 126rpx;"
								></image>
								<image
									:src="require('../static/add.png')"
									mode="widthFix"
									v-if="!idtimage"
									style="width: 126rpx;height: 126rpx;"
								></image>
							</view>
							<view @click="uploadimg(2)">
								<image
									v-if="idoimage"
									:src="'https://www.chejingjing.cn' + idoimage"
									mode="widthFix"
									style="width: 126rpx;height: 126rpx;"
								></image>
								<image
									:src="require('../static/add.png')"
									mode="widthFix"
									v-if="!idoimage"
									style="width: 126rpx;height: 126rpx;"
								></image>
							</view>
						</view>
					</view>
					<view class="logoht b-box" style="margin: 20rpx 0pt;">
						<checkbox-group @change="radioChange">
							<checkbox>已阅读并同意</checkbox>
							<text class="text-green" @click="ynsxie">《用户服务协议》</text>
							及
							<text class="text-green" @click="ynsxie">《隐私政策》</text>
						</checkbox-group>
					</view>
					<!-- 提交 -->
					<view class="w-750 b-box" style="padding: 0 40rpx;">
						<u-button
							:throttleTime="700"
							@click="getorderlists(value)"
							:customStyle="{
								height: '88rpx',
								width: '670rpx',
								font: '500 32rpx PingFang SC',
								color: '#ffffff',
								background: 'linear-gradient(180deg, #4885C5 0%, #3B52A6 100%)',
								borderRadius: '44rpx'
							}"
							shape="square"
							text="提交"
						></u-button>
					</view>
				</view>
			</scroll-view>

			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<scroll-view scroll-y="true" :style="{ height: containerHeight }" v-if="value == '个人'">
				<view style="padding: 20rpx 0 58rpx;">
					<view class="w-750 bg-ff b-box p-x-32" style="margin-bottom: 22rpx;padding-top: 32rpx;">
						<view
							class="d-flex flex-r ali-i-c just-c b-box"
							style="padding: 34rpx 0rpx;border-bottom: 2rpx solid #EEEEEE;"
							@click="showSex = true"
						>
							<text
								class="pf-sc fw-400"
								style="font-size: 30rpx;color: rgba(0,0,0,0.9000);margin-right: 24rpx;"
							>
								合伙人类型
							</text>
							<u-input
								type="text"
								border="none"
								:placeholder="value"
								v-module="value"
								disabledColor="#ffffff"
								disabled
								disableDefaultPadding
								placeholderStyle="color:#000;fontWeight:400;fontsize:30px;fontfamily:PingFang SC-Regular, PingFang SC"
								:customStyle="{ color: 'rgba(0,0,0,0.9000)', font: '400 30rpx PingFang SC' }"
							></u-input>
						</view>
						<u-action-sheet
							:show="showSex"
							:actions="actions"
							title="请选择您的身份"
							@close="showSex = false"
							@select="sexSelect"
						></u-action-sheet>

						<view
							class="d-flex flex-r ali-i-c just-c b-box"
							style="padding: 34rpx 0;border-bottom: 2rpx solid #EEEEEE;"
						>
							<text
								class="pf-sc fw-400"
								style="font-size: 30rpx;color: rgba(0,0,0,0.9000);margin-right: 24rpx;"
							>
								合伙人姓名
							</text>
							<u-input
								type="text"
								border="none"
								placeholder="请输合伙人姓名"
								disabledColor="#ffffff"
								v-model="gerenname"
								placeholderStyle="color:#999999;fontWeight:400;fontsize:30px;fontfamily:PingFang SC-Regular, PingFang SC"
								:customStyle="{ color: 'rgba(0,0,0,0.9000)', font: '400 30rpx PingFang SC' }"
							></u-input>
						</view>

						<view
							class="d-flex flex-r ali-i-c just-c b-box"
							style="padding: 34rpx 0;border-bottom: 2rpx solid #EEEEEE;"
						>
							<text
								class="pf-sc fw-400"
								style="font-size: 30rpx;color: rgba(0,0,0,0.9000);margin-right: 80rpx;"
							>
								手机号
							</text>
							<u-input
								type="number"
								border="none"
								placeholder="请输入手机号"
								v-model="gerenphone"
								placeholderStyle="color:#999999;fontWeight:400;fontsize:30px;fontfamily:PingFang SC-Regular, PingFang SC"
								:customStyle="{ color: 'rgba(0,0,0,0.9000)', font: '400 30rpx PingFang SC' }"
							></u-input>
						</view>

						<view class="d-flex flex-r ali-i-c  b-box" style="padding: 34rpx 0;">
							<view class="d-flex flex-c ali-i-s just-s " style="width: 166rpx;">
								<text class="pf-sc fw-400" style="font-size: 30rpx;color: rgba(0,0,0,0.9000);">
									身份证
								</text>
								<text class="pf-sc fw-400" style="font-size: 30rpx;color: rgba(0,0,0,0.9000);">
									正反面
								</text>
							</view>
							<view @click="uploadimg(1)" style="margin-right: 40rpx;">
								<image
									v-if="idtimage"
									:src="'https://www.chejingjing.cn' + idtimage"
									mode="widthFix"
									style="width: 126rpx;height: 126rpx;"
								></image>
								<image
									v-if="!idtimage"
									:src="require('../static/add.png')"
									mode="widthFix"
									style="width: 126rpx;height: 126rpx;"
								></image>
							</view>
							<view @click="uploadimg(2)">
								<image
									v-if="idoimage"
									:src="'https://www.chejingjing.cn' + idoimage"
									mode="widthFix"
									style="width: 126rpx;height: 126rpx;"
								></image>
								<image
									v-if="!idoimage"
									:src="require('../static/add.png')"
									mode="widthFix"
									style="width: 126rpx;height: 126rpx;"
								></image>
							</view>
						</view>
					</view>

					<view class="logoht b-box" style="margin: 20rpx 0pt;">
						<checkbox-group @change="radioChange">
							<checkbox>已阅读并同意</checkbox>
							<text class="text-green" @click="ynsxie">《用户服务协议》</text>
							及
							<text class="text-green" @click="ynsxie">《隐私政策》</text>
						</checkbox-group>
					</view>
					<!-- 提交 -->
					<view class="w-750 b-box" style="padding: 0 40rpx;margin-top: 92rpx;">
						<u-button
							:throttleTime="700"
							@click="getorderlistsgeren(value)"
							:customStyle="{
								height: '88rpx',
								width: '670rpx',
								font: '500 32rpx PingFang SC',
								color: '#ffffff',
								background: 'linear-gradient(180deg, #4885C5 0%, #3B52A6 100%)',
								borderRadius: '44rpx'
							}"
							shape="square"
							text="提交"
						></u-button>
					</view>
				</view>
			</scroll-view>
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
			<!-- 等于个人的页面 -->
		</view>

		<view
			class="set-pwd-container w-750 b-box  bg-fa po-re"
			:style="{ height: containerHeight }"
			v-if="rz.status == 0"
		>
			<!-- 审核中... -->
			<view
				class="w-750 b-box d-flex flex-c ali-i-c just-c"
				:style="{ height: parseInt(containerHeight) / 2.2 + 'px' }"
			>
				<view style="width:159rpx ;height:120rpx;margin-bottom: 26rpx;">
					<image
						:src="require('../static/shenhez.png')"
						style="width:159rpx ;height:120rpx;"
					></image>
				</view>
				<text class=" pf-sc fw-400" style="font-size: 30rpx;color: #666666;">
					您的门店申请正在审核中...
				</text>
			</view>
		</view>
		<!-- 审核通过 -->
		<view
			class="set-pwd-container w-750 b-box  bg-fa po-re"
			:style="{ height: containerHeight }"
			v-if="rz.status == 1"
		>
			<!-- 审核通过... -->
			<view
				class="w-750 b-box d-flex flex-c ali-i-c just-c"
				:style="{ height: parseInt(containerHeight) / 2.2 + 'px' }"
				style="margin: 0 auto;"
			>
				<view style="margin-bottom: 26rpx;margin: 0 auto;">
					<image
						:src="require('../static/shenhetongguo.png')"
						style="width:191rpx ;height:196rpx;"
					></image>
				</view>
				<text class=" pf-sc fw-400" style="font-size: 30rpx;color: #666666;">
					您的合伙人申请已通过
				</text>
				<view class=" pf-sc fw-400" style="font-size: 30rpx;color: #666666;">
					您的账号：{{ rz.account }}，密码：123456
				</view>
			</view>
		</view>
		<!-- 审核失败 -->
		<view
			class="set-pwd-container w-750 b-box  bg-fa po-re"
			:style="{ height: containerHeight }"
			v-if="rz.status == 2"
		>
			<!-- 审核没有通过... -->
			<view
				class="w-750 b-box d-flex flex-c ali-i-c just-c"
				:style="{ height: parseInt(containerHeight) / 2.2 + 'px' }"
				style="margin: 0 auto;"
			>
				<view style="margin-bottom: 26rpx;margin: 0 auto;">
					<image :src="require('../static/fali.png')" style="width:191rpx ;height:196rpx;"></image>
				</view>
				<text class=" pf-sc fw-400" style="font-size: 30rpx;color: #666666;">
					您的合伙人申请被驳回
				</text>
				<view class=" pf-sc fw-400" style="font-size: 30rpx;color: #666666;margin-top: 20rpx;">
					驳回原因：{{ rz.reason }}
				</view>
				<button
					@click="goShenQing"
					style="color: #26387C;width: 240rpx;height: 74rpx;border-radius: 37rpx;border: 2rpx solid #26387C;line-height: 74rpx;margin-top: 100rpx;font-size: 24rpx;"
				>
					重新申请
				</button>
			</view>
		</view>
	</view>
</template>

<script>
import { _containerHeight } from '@/utils/GetSys.js';
import Unavbar from '../components/uview-ui/components/u-navbar/u-navbar';
import Uinput from '../components/uview-ui/components/u-input/u-input';
import Ubutton from '../components/uview-ui/components/u-button/u-button';
import uUpload from '../components/uview-ui/components/u-upload/u-upload';
import pickRegions from '../components/pick-regions/pick-regions';

import { shopapply, usershopapply } from '@/common/api.js';

export default {
	components: {
		'u-navbar': Unavbar,
		'u-input': Uinput,
		'u-button': Ubutton,
		'u-upload': uUpload,
		'pick-regions': pickRegions
	},
	data() {
		return {
			value: '门店',
			showSex: false,
			actions: [
				{
					name: '门店'
				},
				{
					name: '个人'
				}
			],
			containerHeight: '',
			ApplicationStatus: true, //申请状态
			radioChanges: 0,
			shopimages: [], //门店照片或营业执照
			idtimage: '', //身份证正
			idoimage: '', //身份证反面
			region: [],
			defaultRegion: ['河南省', '郑州市', '中原区'],
			defaultRegionCode: '410102',
			showAddress: '', //选择的地区
			user: '',
			rz: {
				identity: '', //姓名
				mobile: '', //手机号
				address: '' //详细地址
			},
			phone: '',
			name: '',
			gerenname: '',
			gerenphone: '',
			dizhiXX: '',
			imgMd: []
		};
	},
	methods: {
		sexSelect(e) {
			this.value = e.name;
		},
		ynsxie() {
			uni.navigateTo({
				url: '/staffModelA/staffB/userinfoadd/userinfoadd'
			});
		},
		goShenQing() {
			this.rz = {};
			this.rz.status = '99';
		},
		getlists(type) {
			let params = {
				token: uni.getStorageSync('usertoken'),
				type: 1 //1查看，2提交
			};

			if (this.user == 'user') {
				usershopapply(params).then(res => {
					console.log(res.data, '用户端获取成功');
					if (res.data.data) {
						this.rz = res.data.data;
					}
				});
			} else if (this.user == 'worker') {
				shopapply(params).then(res => {
					console.log(res.data, '师傅端获取成功');
					if (res.data.data) {
						this.rz = res.data.data;
					}
				});
			}
		},
		uploadimg(type) {
			if (type == 0) {
				uni.chooseImage({
					success: res => {
						if (res.tempFilePaths.length > 9) {
							uni.showToast({
								title: '单次选择的图片不能超过9张',
								icon: 'none'
							});
							return;
						}
						if (this.shopimages.length + res.tempFilePaths.length > 9) {
							uni.showToast({
								title: '多次选择的图片不能超过9张',
								icon: 'none'
							});
							return;
						}
						this.shopimages.push(...res.tempFilePaths);
					}
				});
			} else if (type == 1) {
				uni.chooseImage({
					count: 1,
					success: res => {
						uni.uploadFile({
							url: 'https://www.chejingjing.cn/api/index/uploadimg',
							filePath: res.tempFilePaths[0],
							name: 'photo',
							formData: {
								photo: res.tempFilePaths[0]
							},
							success: res1 => {
								this.idtimage = JSON.parse(res1.data).data.url1;
							}
						});
					}
				});
			} else if (type == 2) {
				uni.chooseImage({
					count: 1,
					success: res => {
						uni.uploadFile({
							url: 'https://www.chejingjing.cn/api/index/uploadimg',
							filePath: res.tempFilePaths[0],
							name: 'photo',
							formData: {
								photo: res.tempFilePaths[0]
							},
							success: res1 => {
								this.idoimage = JSON.parse(res1.data).data.url1;
							}
						});
					}
				});
			}
		},
		//申请合伙人
		getorderlists(value) {
			for (var i = 0; i < this.shopimages.length; i++) {
				uni.uploadFile({
					url: 'https://www.chejingjing.cn/api/index/uploadimg',
					filePath: this.shopimages[i],
					name: 'photo',
					formData: {
						photo: this.shopimages[i]
					},
					success: res => {
						this.imgMd.push(JSON.parse(res.data).data.url1);
					}
				});
			}
			//如果value是门店 走这个请求

			if (value == '门店') {
				setTimeout(() => {
					if (this.radioChanges == 0) {
						return uni.showToast({
							icon: 'none',
							title: '请先允许用户隐私协议'
						});
					}
					if (this.name == '') {
						return uni.showToast({
							title: '请输入您的姓名',
							icon: 'none'
						});
					}
					if (this.phone == '') {
						return uni.showToast({
							title: '请输入您的手机号',
							icon: 'none'
						});
					}
					let reg = /^1[3-8]\d{9}$/;
					if (!reg.test(this.phone)) {
						uni.showToast({
							title: '请填写正确的手机号',
							icon: 'none'
						});
						return false;
					}
					if (this.showAddress == '') {
						uni.showToast({
							title: '请选择你所在的地区',
							icon: 'none'
						});
						return false;
					}
					if (!this.dizhiXX) {
						uni.showToast({
							icon: 'none',
							title: '请输入详细地址'
						});
						return false;
					}
					if (this.imgMd.length == 0) {
						uni.showToast({
							icon: 'none',
							title: '请上传门店照片或营业执照'
						});
						return false;
					}
					if (this.idtimage == '') {
						uni.showToast({
							icon: 'none',
							title: '请上传身份证正面照片'
						});
						return false;
					}
					if (this.idoimage == '') {
						uni.showToast({
							icon: 'none',
							title: '请上传身份证反面照片'
						});
						return false;
					}
					uni.showLoading({
						title: '正在提交...'
					});
					setTimeout(() => {
						let params = {
							token: uni.getStorageSync('usertoken'),
							type: 2, //1查看，2提交
							shopname: this.name, //入住名称  合伙人姓名  申请姓名
							mobile: this.phone, //手机号
							area: this.showAddress, //所在地区
							address: this.dizhiXX, //详细地址
							shopimages: this.imgMd.join(','),
							idoimage: this.idoimage,
							idtimage: this.idtimage,
							leixing: value
						};
						if (this.user == 'user') {
							usershopapply(params).then(res => {
								if (res.data.code == 1) {
									uni.showToast({
										title: '提交成功'
									});
									setTimeout(() => {
										uni.switchTab({
											url: '/pages/UserCenter/UserCenter'
										});
									}, 1000);
								} else {
									uni.showToast({
										title: res.data.msg,
										icon: 'none'
									});
								}
							});
						} else if (this.user == 'worker') {
							shopapply(params).then(res => {
								if (res.data.code == 1) {
									uni.showToast({
										title: '提交成功'
									});
									setTimeout(() => {
										uni.switchTab({
											url: '/pages/UserCenter/UserCenter'
										});
									}, 1000);
								} else {
									uni.showToast({
										title: res.data.msg,
										icon: 'none'
									});
								}
							});
						}
						setTimeout(() => {
							uni.hideLoading();
						}, 1000);
					}, 1000);
				}, 500);
			}
		},
		getorderlistsgeren(value) {
			if (this.radioChanges == 0) {
				return uni.showToast({
					icon: 'none',
					title: '请先允许用户隐私协议'
				});
			}
			if (this.gerenname == '') {
				return uni.showToast({
					title: '请输入姓名',
					icon: 'none'
				});
			}
			if (this.gerenphone == '') {
				return uni.showToast({
					title: '请输入手机号',
					icon: 'none'
				});
			}
			let reg = /^1[3-8]\d{9}$/;
			if (!reg.test(this.gerenphone)) {
				uni.showToast({
					title: '请填写正确的手机号',
					icon: 'none'
				});
				return false;
			}
			if (this.idtimage == '') {
				uni.showToast({
					icon: 'none',
					title: '请上传身份证正面照片'
				});
				return false;
			}
			if (this.idoimage == '') {
				uni.showToast({
					icon: 'none',
					title: '请上传身份证反面照片'
				});
				return false;
			}
			let params = {
				token: uni.getStorageSync('usertoken'),
				type: 2, //1查看，2提交
				shopname: this.gerenname, //入住名称  合伙人姓名  申请姓名
				mobile: this.gerenphone, //手机号
				area: '', //所在地区
				address: '', //详细地址
				shopimages: '',
				idoimage: this.idoimage,
				idtimage: this.idtimage,
				leixing: value
			};
			if (this.user == 'user') {
				uni.showLoading({
					title: '正在提交...'
				});
				setTimeout(() => {
					usershopapply(params).then(res => {
						if (res.data.code == 1) {
							uni.showToast({
								title: '提交成功'
							});
							uni.hideLoading();
							setTimeout(() => {
								uni.switchTab({
									url: '/pages/UserCenter/UserCenter'
								});
							}, 2000);
						}
					});
				}, 1000);
			} else if (this.user == 'worker') {
				uni.showLoading({
					title: '正在提交...'
				});
				setTimeout(() => {
					shopapply(params).then(res => {
						if (res.data.code == 1) {
							uni.showToast({
								title: '提交成功'
							});
							uni.hideLoading();
							setTimeout(() => {
								uni.switchTab({
									url: '/pages/UserCenter/UserCenter'
								});
							}, 2000);
						}
					});
				}, 1000);
			}
		},
		// 获取选择的地区
		handleGetRegion(region) {
			this.region = region;
			this.showAddress = `${region[0].name}/${region[1].name}/${region[2].name}`;
		},

		radioChange(e) {
			console.log(e);
			this.radioChanges = !this.radioChanges;
		},
		Submit() {
			//提交申请
			this.ApplicationStatus = false;
		}
	},
	onLoad(options) {
		this.user = options.user;
		console.log(this.user, 'this.user');
		this.containerHeight = _containerHeight();
		this.getlists();
	}
};
</script>

<style lang="scss">
.join-the-store {
}
</style>
